package com.easemob.chatuidemo.activity;

import android.os.Bundle;
import android.webkit.CookieManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.easemob.chatuidemo.R;

/**
 * Created by apc_allen on 15/5/30.
 */
public class WebViewAvtivity extends BaseActivity {
    String url = "http://www.365jiaju.com";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_flyint_webview);

        WebView webView = (WebView) findViewById(R.id.webview);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl(url);
        CookieManager.getInstance().setAcceptCookie(true);
        webView.setWebViewClient(new WAPWebViewClient());
    }


    public class WAPWebViewClient extends WebViewClient {
        public boolean shouldOverviewUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
    }
}
